Re: [SQL] Newbie questions - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] Newbie questions
Date
Msg-id l03110710b29c1f4a7f9f@[147.233.159.109]
Whole thread Raw
In response to Re: [SQL] Newbie questions  (Remigiusz Sokolowski <rems@gdansk.sprint.pl>)
List pgsql-sql
At 15:41 +0200 on 15/12/98, Remigiusz Sokolowski wrote:


> So if they do match - I don't need to use with them some wild characters
> (* or %)? And second question: Can I use % with = operator?
> I know - simple question, but I feel now a little confused - manual
> doesn't clear it either - I thought about it, but as long as all works
> fine - I haven't needed this knowledge.

Make the distinction between a MATCH and an EQUALITY. A "match" is
comparing to a pattern, and there can be more than one text that makes the
comparison work. The '=' does not take wildcards - it is an equality test.
It tests *exactly*.

An equality test has an advantage in index usage. Case-insensitive matching
doesn't trigger indices in any case (as far as I know). Case-sensitive
matching triggers them only if the pattern is anchored to the left (That
is, in a LIKE comparison, the pattern doesn't start with % or _, and in
regular expression, it starts with a ^ followed by simple characters).

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma



pgsql-sql by date:

Previous
From: Remigiusz Sokolowski
Date:
Subject: Re: [SQL] Newbie questions
Next
From: David Hartwig
Date:
Subject: Re: [SQL] MINUS and slow 'not in'